package com.guigu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.mapper.PayDetailsMapper;
import com.guigu.pojo.PayDetails;
import com.guigu.service.PayDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 出库单明细表 服务实现类
 * </p>
 *
 * @author Mr.Zhang
 * @since 2025-03-12
 */
@Service
public class PayDetailsServiceImpl extends ServiceImpl<PayDetailsMapper, PayDetails> implements PayDetailsService {

    @Autowired
    private PayDetailsMapper payDetailsMapper;

    @Override
    public List<PayDetails> getPayDetails(Integer payId) {
        List<PayDetails> payDetails = payDetailsMapper.getPayDetails(payId);

        System.out.println(payDetails);
        return payDetails;
    }

    @Override
    public List<PayDetails> getPayDetails2(Integer payId) {
        QueryWrapper<PayDetails> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("pay_id",payId);
        List<PayDetails> payDetails = payDetailsMapper.selectList(queryWrapper);

        System.out.println(payDetails);
        return payDetails;
    }
}
